<template>
  <div class="paper">
    <div>
      <p class="title">
        {{ title }}
        <Button
          v-if="handle"
          class="refresh"
          size="small"
          :icon="icon"
          @click="handle"
        ></Button>
      </p>
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "Paper",
  props: {
    title: {
      type: String,
      default: "段落标题",
    },
    icon: {
      type: String,
      default: "md-refresh",
    },
    handle: {
      type: Function,
      default: null,
    },
  },
  data() {
    return {};
  },
};
</script>

<style scoped lang="less">
.paper {
  width: auto;
  height: auto;
  margin-bottom: 12px;
  margin-top: 4px;
  background: #fff;
  box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);
  border-radius: 15px;
  padding-top: 14px;
  padding-bottom: 14px;
  padding-left: 20px;
  padding-right: 20px;
  display: flex;
  flex-direction: column;
}
.title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(51, 56, 61, 1);
  margin-right: 10px;
  margin-bottom: 10px;
}
.refresh {
  margin-top: -2px;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  margin-left: 4px;
}
</style>